Skip to content

fix(workstreams): recover interrupted member key initialization - #941

Merged
Mjones13 merged 1 commit into
mainfrom
fix/workstreams-member-key-recovery-ec04f4fa-20261111
Nov 12, 2026
Merged

Mjones13 merged 1 commit into
mainfrom
fix/workstreams-member-key-recovery-ec04f4fa-20261111

Conversation

@Mjones13

@Mjones13 Mjones13 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

A committed registry keys member-init transaction could be reported as failed and have its key file deleted; an interruption before commit could leave an orphan file that blocked retry. Reconcile the exact key row outside a reported transaction failure, retain uncertain files with outcome_unknown, and remove only this attempt's unchanged file after proved row absence.

Add an explicit --resume that reuses valid 32-byte orphan keys or accepts an exact active row and file without changing bytes. Malformed files remain untouched, conflicts refuse, and a row without its file reports key_file_missing without regenerating that ID. Home key initialization is unchanged. The peer-setup integration fixture now provisions its member key through NativeMemberKeyAdmin and the real secret store before exercising peer setup and member startup.

Closes #937.

Validation:

  • The two focused files passed all 47 tests with one worker and file parallelism disabled: native/runtime/cli.test.ts and native/conformance/peerSetupIntegration.test.ts. After converting the fault cases to the required table-driven test syntax, the CLI file passed all 17 tests again.
  • The committed-then-error regression fails against the original source and passes against the repair; it also verifies actual WorkstreamsKeyProvider resolution.
  • pnpm --filter t3 typecheck passed with the verified official Effect compiler.
  • node scripts/jones/check-boundary.ts --strict passed with zero violations.
  • Targeted lint and formatting passed for all three changed files.

This is source-only work; no installed runtime update or live-state repair. Scope is the CLI service and its two focused test files. There are no schema, rotation, wire, or persisted-history changes.

Implemented by the scoped implementation child in Jones Code using gpt-6.1-sol (high reasoning), Codex harness.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@Mjones13
Mjones13 merged commit 4908877 into main Nov 12, 2026
31 checks passed
Mjones13 added a commit that referenced this pull request Nov 12, 2026
Brings in #933 (Claude provider HOME binding and lifecycle proof), #938/#939
(workstreams reader ownership and mixed-version coverage) and #941 (member key
recovery).

Resolutions:
- ClaudeDriver keeps the sync's Claude process environment and binds main's
  provider home from it.
- ClaudeAdapterV2 keeps the sync's transcript state (conversation, empty,
  missing, unreadable) and reads it under main's provider home path; the
  resume test takes main's HOME/config parameterization on the sync's
  SecureRandom adapter input.
- Member-key initialization takes main's interrupted-key recovery on the
  sync's SecureRandom, whose randomBytes cannot fail.
- Effect 4.1.2 adaptations: NodeCrypto for main's new tests and the lifecycle
  dev entrypoint, NodeWS for its WebSocket.
- Boundary inventory merged structurally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(workstreams): recover member key initialization safely

1 participant